#include "shm.h"
int main(int argc, char const *argv[])
{
	
	signal(SIGINT,signal_fun);
	pid_t peer_pid;
	peer_pid =get_peer_pid(); 
	create_or_get_shm();
	//建立映射
	shmaddr=shmat(shmid,NULL,0);
	if(shmaddr == (void *) -1) print_err("shmaddr error");

	while(1){
		scanf("%s",buf);
		memcpy(shmaddr,buf,sizeof(buf));
		printf("send signal to %d\n",peer_pid );
		kill(peer_pid,SIGUSR1);
		sleep(1);
	}
	return 0;
}

